home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / AErenderLayerNoScroll.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.1 KB  |  155 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //
  20. //  Creation Date:    October 29, 1999
  21. //  Author:        Bruce Hickey
  22. //
  23. //  Procedure Name:
  24. //    AErenderLayerNoScroll
  25. //
  26. //  Description Name;
  27. //    Creates the attribute editor controls for the renderLayer Node
  28. //
  29. //  Input Value:
  30. //    nodeName 
  31. //
  32. //  Output Value:
  33. //    None
  34. // 
  35.  
  36. global proc changeRenderLayerNumber ( string $id )
  37. {
  38.     string $parent = `setParent -q`;
  39.     int $idValue = `intFieldGrp -q -v1 renderLayerNumberField`;
  40.  
  41.     // If this layer is connected to the render layer manager, which all
  42.     // layers should be, then that is the field we want to edit.  (It is
  43.     // not available in the render layer manager attribute editor.)
  44.     //
  45.     // This hides the implementation of the id from the user.
  46.     //
  47.     string $cmd = ("listConnections -d on -p on " + $id);
  48.     string $srcList[] = `eval $cmd`;
  49.     if( size($srcList) > 0 )
  50.     {
  51.         if( catch(`setAttr $srcList[0] $idValue`) )
  52.         {
  53.             updateRenderLayerNumber( $parent, $id );
  54.         }
  55.     }
  56.     else
  57.     {
  58.         // If no connection then try to set it directly
  59.         //
  60.         if( catch(`setAttr $id $idValue`) )
  61.         {
  62.             updateRenderLayerNumber( $parent, $id );
  63.         }
  64.     }
  65. }
  66.  
  67. global proc updateRenderLayerNumber (string $parent, string $id)
  68. {
  69.     intFieldGrp -e -v1 `getAttr $id` ($parent + "|renderLayerNumberField");
  70. }
  71.  
  72. //
  73. //  Procedure Name:
  74. //    renderLayerNumberNew
  75. //
  76. global proc renderLayerNumberNew ( string $id )
  77. {
  78.     setUITemplate -pst attributeEditorTemplate;
  79.         intFieldGrp -l "Number" -v1 0
  80.             -cc ("changeRenderLayerNumber " + $id)
  81.             renderLayerNumberField;
  82.     setUITemplate -ppt;
  83.  
  84.     renderLayerNumberReplace  $id;
  85. }
  86.  
  87.  
  88. //
  89. //  Procedure Name:
  90. //    renderLayerNumberReplace
  91. //
  92. //
  93. global proc renderLayerNumberReplace (string $id)
  94. {
  95.     intFieldGrp -e -cc ("changeRenderLayerNumber " + $id)
  96.         renderLayerNumberField;
  97.  
  98.     string $parent = `setParent -q`;
  99.     scriptJob -p $parent -rp -attributeChange $id 
  100.         ("updateRenderLayerNumber "+$parent+" "+$id);
  101.  
  102.     updateRenderLayerNumber( $parent, $id );
  103.  
  104.     // Disable the number for the default layer.  It is not allowed to change.
  105.     //
  106.     int    $value = 1;
  107.     string $mgr[] = `ls -type renderLayerManager`;
  108.     if( size($mgr) > 0 )
  109.     {
  110.         string $def[]=`listConnections -p on ($mgr[0] + ".renderLayerId[0]")`;
  111.         if( (size($def) > 0)
  112.         &&  ($def[0] == $id) )
  113.         {
  114.             $value = 0;
  115.         }
  116.     }
  117.     intFieldGrp -e -en ($value) renderLayerNumberField;
  118. }
  119.  
  120. //
  121. //  Procedure Name:
  122. //    AErenderLayerTemplate
  123. //
  124.  
  125. global proc AErenderLayerNoScroll ( string $nodeName )
  126. {
  127.     editorTemplate -beginLayout "Render Layer Options" -collapse 0;
  128.         editorTemplate -addControl "renderable";
  129.         editorTemplate -addControl "displayOrder";
  130.          //editorTemplate -addControl "drawColor"; 
  131.  
  132.         editorTemplate -beginLayout "Render Pass Options" -collapse 1;
  133.             editorTemplate -addControl "beauty";  
  134.             editorTemplate -addControl "color";  
  135.             editorTemplate -addControl "shadow";  
  136.             editorTemplate -suppress "ambient";  
  137.             editorTemplate -addControl "diffuse";  
  138.             editorTemplate -addControl "specular";  
  139.         editorTemplate -endLayout;
  140.  
  141.     editorTemplate -endLayout;
  142.  
  143.  
  144.     // suppressed attributes
  145.  
  146.     editorTemplate -suppress "identification";
  147.     editorTemplate -suppress "renderPassInfo";
  148.     editorTemplate -suppress "renderInfo";
  149.  
  150.  
  151.     // include/call base class/node attributes
  152.  
  153.     AEdependNodeTemplate $nodeName;
  154. }
  155.